// pages/mine/mine.js
Component({
  /**
   * 组件的属性列表
   */
  properties: {

  },

  /**
   * 组件的初始数据
   */
  data: {
    userName: '',
    sex: '',
    other: '',
    realName: '',
  },

  /**
   * 组件的方法列表
   */
  methods: {
    toLogin: function(){
      wx.navigateTo({
        url: '/pages/login/login',
      })


    }

  },
  attached(){
    var that = this;
    wx.request({
      url: 'http://120.79.197.164:9285/barter/user/getUserByUserId/' + wx.getStorageSync('uuid'),
      method: 'GET',
      data: {
      },
      header: {
        'content-type': 'application/json' // 默认值
      },
      success(res) {
        that.setData({
          userName: res.data.data.userName,
          realName: res.data.data.realName,
          sex: res.data.data.sex,
          other: "这个人很懒什么都没留下，除了这串电话号码：" + res.data.data.tel,
        });
      }

    });

  },
  created(){
    console.log("别点我！");
  },
})
